/**
  * Author: Mei
  * Date: 2020-12-09 15:25
  * Description: 
  * 一致性初始化
  */
#include <vector>
#include <iostream>
#include <bitset>

using namespace std;

template<typename T>
class complex {
private:
    double image;
    double real;
public:
    complex(double i, double r) : image(i), real(r) {}

    void display() {
        cout << "image=" << this->image << ",real=" << this->real << endl;
    }
};

int main() {
    int values[]{1, 2, 3}; //编译器只要看到{} 做出一个initializer_list<T> 然后逐一拿出来
    initializer_list<int> li{5, 4, 3, 1};
    vector<int> v1(li);
    vector<int>::iterator iter; //好比一个引用
    for (auto va : v1) {
        cout << va << endl;
    }
    vector<int> v{4, 5, 6, 7};
    vector<string> cities{
            "beijing", "shanghai", "London"
    };
    complex<double> c{4.0, 3.0};
    c.display();

    int a{}; //设初值0
    int a1 = 3;
    int *p{}; //设初值为nullptr
    int *p1 = nullptr;
    cout << a << "," << a1 <<","<< p << endl;


    return 0;
}